import request from '@/utils/request'

// 查询菜单嵌套数据
export const GetNestedMenus = () => {
  return request({
    url: `/admin/system/menu/findNestdMenus`,
    method: 'get',
  })
}
//根据id删除菜单
export const DeleteMenuById = id => {
  return request({
    url: `/admin/system/menu/deleteById/${id}`,
    method: 'DELETE',
  })
}
//根据id查询菜单
export const GetMenuById = id => {
  return request({
    url: `/admin/system/menu/getById/${id}`,
    method: 'GET',
  })
}
//更新菜单
export const UpdateMenuById = menu => {
  return request({
    url: `/admin/system/menu/updateById`,
    method: 'PUT',
    data: menu,
  })
}
//新增菜单
export const SaveMenu = menu => {
  return request({
    url: `/admin/system/menu/save`,
    method: 'POST',
    data: menu,
  })
}
